glarea: Avoid a crash
authorMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jan 2018 00:48:33 +0000 (19:48 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jan 2018 00:48:33 +0000 (19:48 -0500)
We must only delete the texture if it is not NULL.

gtk/gtkglarea.c

index efe4899cab589c9733c91447468816fa29f6f5ee..8e3cf4cc75bbf03198a1b4ccf046affc865b6382 100644 (file)
@@ -601,8 +601,11 @@ gtk_gl_area_delete_textures (GtkGLArea *area)
 {
   GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
 
-  delete_one_texture (priv->texture);
-  priv->texture = NULL;
+  if (priv->texture)
+    {
+      delete_one_texture (priv->texture);
+      priv->texture = NULL;
+    }
 
   /* FIXME: we need to explicitly release all outstanding
    * textures here, otherwise release_texture will get called